package com.ruoyi.system.wnjk.service.impl;

import com.ruoyi.system.wnjk.domain.po.PhysicalOrder;
import com.ruoyi.system.wnjk.domain.po.WnjkRegistrationOrder;
import com.ruoyi.system.wnjk.mapper.WnjkRegistrationOrderMapper;
import com.ruoyi.system.wnjk.service.IWnjkRegistrationOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 挂号订单Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-16
 */
@Service
public class WnjkRegistrationOrderServiceImpl implements IWnjkRegistrationOrderService
{
    @Autowired
    private WnjkRegistrationOrderMapper wnjkRegistrationOrderMapper;

    /**
     * 查询挂号订单
     *
     * @param id 挂号订单主键
     * @return 挂号订单
     */
    @Override
    public WnjkRegistrationOrder selectWnjkRegistrationOrderById(Long id)
    {
        return wnjkRegistrationOrderMapper.selectWnjkRegistrationOrderById(id);
    }

    /**
     * 查询挂号订单列表
     *
     * @param wnjkRegistrationOrder 挂号订单
     * @return 挂号订单
     */
    @Override
    public List<WnjkRegistrationOrder> selectWnjkRegistrationOrderList(WnjkRegistrationOrder wnjkRegistrationOrder)
    {
        return wnjkRegistrationOrderMapper.selectWnjkRegistrationOrderList(wnjkRegistrationOrder);
    }

    /**
     * 新增挂号订单
     *
     * @param wnjkRegistrationOrder 挂号订单
     * @return 结果
     */
    @Override
    public int insertWnjkRegistrationOrder(WnjkRegistrationOrder wnjkRegistrationOrder)
    {
        return wnjkRegistrationOrderMapper.insertWnjkRegistrationOrder(wnjkRegistrationOrder);
    }

    /**
     * 修改挂号订单
     *
     * @param wnjkRegistrationOrder 挂号订单
     * @return 结果
     */
    @Override
    public int updateWnjkRegistrationOrder(WnjkRegistrationOrder wnjkRegistrationOrder)
    {
        return wnjkRegistrationOrderMapper.updateWnjkRegistrationOrder(wnjkRegistrationOrder);
    }

    /**
     * 批量删除挂号订单
     *
     * @param ids 需要删除的挂号订单主键
     * @return 结果
     */
    @Override
    public int deleteWnjkRegistrationOrderByIds(Long[] ids)
    {
        return wnjkRegistrationOrderMapper.deleteWnjkRegistrationOrderByIds(ids);
    }

    /**
     * 删除挂号订单信息
     *
     * @param id 挂号订单主键
     * @return 结果
     */
    @Override
    public int deleteWnjkRegistrationOrderById(Long id)
    {
        return wnjkRegistrationOrderMapper.deleteWnjkRegistrationOrderById(id);
    }

    @Override
    public List<WnjkRegistrationOrder> selectExpiredOrders() {
        return wnjkRegistrationOrderMapper.selectExpiredOrders(new Date());
    }

    @Override
    public int updateExpiredOrder(WnjkRegistrationOrder order) {
        return wnjkRegistrationOrderMapper.updateExpiredOrder(order);
    }

    @Override
    public WnjkRegistrationOrder selectByOrderNumber(String orderNumber) {
        return wnjkRegistrationOrderMapper.selectByOrderNumber(orderNumber);
    }
}
